// 用来对{history: string, refresh_history: string }做本地持久化

import { SearchHistory } from '@/types/data'

const history_KEY = 'geek-h5-history'

// 获取 history
export function gethistory(): SearchHistory {
  return JSON.parse(localStorage.getItem(history_KEY) || '[]') 
}

// 设置 history
export function sethistory(data: SearchHistory): void {
  localStorage.setItem(history_KEY, JSON.stringify(data))
}

// 移除 history
export function removehistory(): void {
  localStorage.removeItem(history_KEY)
}
